<template>
  <div class="app-container">
    <el-form label-width="120px" :model="ruleForm" ref="ruleForm">
      <el-row :gutter="24" style="margin-bottom: 60px;">
        <el-divider content-position="left">
          <legend class="divider-line">单品立减详情</legend>
        </el-divider>
        <el-col :span="24">
          <el-form-item label="活动名称：">
            <div class="yxkj-word-black">{{ actSingle.actSingleName }}</div>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="活动类型：">
            <div class="yxkj-word-black">{{ codeBox.ACT_SINGLE_TYPE[actSingle.type] }}</div>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="优惠额/折扣：">
            <div class="yxkj-word-black">{{ actSingle.discount }}</div>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="活动商品：">
            <el-table
              ref="singleTable"
              :data="productList"
              border
              fit
              highlight-current-row
              @current-change="handleCurrentChange"
              style="width: 100%">
              <el-table-column type="index" align="center" width="50"></el-table-column>
              <el-table-column property="name1" label="商品名称"></el-table-column>
              <el-table-column property="mallPcPrice" width="120" label="PC价格"></el-table-column>
              <el-table-column property="malMobilePrice" width="120" label="移动价格"></el-table-column>
            </el-table>
          </el-form-item>
        </el-col>


        <el-col :span="24">
          <el-form-item label="活动时间：">
            <div class="yxkj-word-black">{{ actSingle.startTime }} - {{ actSingle.endTime }}</div>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="活动渠道：">
            <div class="yxkj-word-black">{{ codeBox.CHANNEL[actSingle.channel] }}</div>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="活动备注：">
            <div class="yxkj-word-black">{{ actSingle.remark }}</div>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row :gutter="24">
        <div class="fixed-bottom-20">
            <el-button type="success" @click="back()">返回</el-button>
        </div>
      </el-row>
    </el-form>
  </div>
</template>
<script>
import { auditActSingle, doauditActSingle } from "@/api/promotionbasics";
import { getCodeManager } from "@/api/all";
import { Message } from 'element-ui'
export default {
  name: "actsingledetail",
  data() {
    return {
      actSingle: {},
      productList: []
    };
  },
  created() {
    let id = this.$route.query.id;
    auditActSingle({ actSingleId: id }).then(res => {
      this.actSingle = res.data.data.actSingle
      this.productList = res.data.data.productList
    });
    getCodeManager("ACT_STATUS,CHANNEL,ACT_SINGLE_TYPE", () => {});
  },
  methods: {
    back() {
      history.back();
    }

  }
};
</script>
<style scoped>
.divider-line {
  font-size: 20px;
  font-weight: 300;
}
.el-form-item {
  margin-bottom: 5px;
}
.picture-list {
  display: flex;
}
.picture-list li {
  list-style: none;
  margin-right: 10px;
}
</style>
